package mobilesearch.receiver;

import java.util.ArrayList;

import mobilesearch.data.EmailData;
import mobilesearch.ui.OnSearchResultListener;
import android.util.Log;

public class EmailReceiver {
	private static final String TAG = "EmailReceiver";
	private ArrayList<EmailData> emailList;
	private OnSearchResultListener listener;
	
	public EmailReceiver(ArrayList<EmailData> emailData, OnSearchResultListener listener) {
		this.emailList = emailData;
		this.listener = listener;
	}
	
	public void processEmailData(){
		int size = this.emailList.size();
		Log.i(TAG, "email list"+ size);
		for(int i = 0; i < size; i++){
			EmailData data = this.emailList.get(i);
			String sendAddress = data.getSendAddress();
			String recAddress = data.getRecAddress();
			this.listener.onReceiveEmailData(sendAddress, recAddress);
		}
	}


}
